package com.qf.feign;

import com.qf.pojo.Customer;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 千锋健哥
 */
@FeignClient(value = "QF-SEARCH", fallback = CustomerFeignFallback.class)
public interface CustomerFeign {

    /**
     * 查询一个
     * @param id
     * @return
     */
    @GetMapping("/customer/one/{id}")
    public Customer findOne(@PathVariable(value = "id") Integer id);

    @GetMapping("/customer/all")
    public List<Customer> findAll();

    @PostMapping("/customer/add")
    public String add(@RequestBody Customer customer);

    @PutMapping("/customer/update")
    public String update(@RequestBody Customer customer);

    @DeleteMapping("/customer/delete/{id}")
    public String delete(@PathVariable(value = "id") Integer id);
}
